package com.lyy.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Id;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;

@Data
@TableName("tb_menu")
public class Menu {
    @Id
    @TableId(value = "id", type = IdType.AUTO)  //很重要，不加会造成ID特别大
    private Long id;

    @ApiModelProperty(value = "父级id")
    private Long parentId;

    @ApiModelProperty(value = "菜单名称")
    private String menuName;

    @ApiModelProperty(value = "菜单url")
    private String url;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "是否展开")
    private Integer open;

    @ApiModelProperty(value = "菜单类型")
    private Integer type;

    @ApiModelProperty(value = "排序")
    private Long orderNum;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)  //mybatis-plus自动填充时间
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)  //mybatis-plus自动填充时间
    private Date modifiedTime;

    @ApiModelProperty(value = "是否可用")
    private Integer available;

    @ApiModelProperty(value = "权限编码")
    private String perms;

}
